package canglang.monitor.cases.service.impl;

import canglang.monitor.cases.dao.CaseEightDAO;
import canglang.monitor.cases.model.CaseEightModel;
import canglang.monitor.cases.service.CaseEightMgr;
import canglang.monitor.cases.to.SearchEightTO;
import canglang.monitor.core.base.pagination.PaginatedListHelper;

import java.util.List;

public class CaseEightMgrImpl implements CaseEightMgr {

	private CaseEightDAO caseEightDAO;

	public void setCaseEightDAO(CaseEightDAO caseEightDAO) {
		this.caseEightDAO = caseEightDAO;
	}

	public CaseEightModel addCaseEight(CaseEightModel caseEightModel) {
		int id=caseEightDAO.addCaseEight(caseEightModel);
		return caseEightDAO.getCaseEight(id);
	}

	public CaseEightModel getCaseEight(int caseEightId) {
		return caseEightDAO.getCaseEight(caseEightId);
	}

	public CaseEightModel saveCaseEight(CaseEightModel caseEightModel) {
        return caseEightDAO.saveCaseEight(caseEightModel);
	}

	public void deleteCaseEight(int caseEightId) {
		caseEightDAO.deleteCaseEight(caseEightId);
	}

    public PaginatedListHelper search(PaginatedListHelper helper, SearchEightTO searchTO){
        int count = caseEightDAO.searchCount(searchTO);
        helper.setFullListSize(count);
        List list = caseEightDAO.searchList(helper, searchTO);
        helper.setList(list);
        return helper;
    }

     public List getCaseEightList(SearchEightTO searchTO){
        return caseEightDAO.getCaseEightList(searchTO);
    }
}